package com.demonzym.gtv.xml;

import com.demonzym.gtv.metadata.TimeList;
import com.demonzym.gtv.metadata.TvList;
import com.demonzym.gtv.xml.converter.TimeListConverter;
import com.demonzym.gtv.xml.converter.TvListConverter;
import com.thoughtworks.xstream.XStream;

public class XMLPaser {
	public static TvList parseTvList(String xml){
		XStream xs = new XStream();
		xs.registerConverter(new TvListConverter());
		xs.alias("tvlist", TvList.class);
		return (TvList) xs.fromXML(xml);
	}
	
	public static TimeList parseTimeList(String xml){
		XStream xs = new XStream();
		xs.registerConverter(new TimeListConverter());
		xs.alias("timelist", TimeList.class);
		return (TimeList) xs.fromXML(xml);
	}
}
